<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
  <meta name="description" content="">
  <meta name="author" content="ThemeBucket">
  <link rel="shortcut icon" href="#" type="<%=request.getContextPath() %>/image/png">
  <title>欢迎模版页</title>
  <!--data table-->
  <link rel="stylesheet" href="<%=request.getContextPath() %>/js/data-tables/DT_bootstrap.css" />
</head>
<body class="sticky-header" onload="indexmenu('${oneMenu}','${twoMenu}');">
<%@ include file="../index/index.jsp"%>
<section>
    <div class="main-content" >
    	<!-- 	地址栏 -->
		<div class="page-heading">
            <h3>
                	后台管理系统
            </h3>
            <ul class="breadcrumb">
                <li>
                    <a href="#">订单管理</a>
                </li>
                <li class="active">顾客订单</li>
            </ul>
        </div>    
        <!--内容开始的地方-->
	<section class="panel">
						<header class="panel-heading custom-tab turquoise-tab">
                            <ul class="nav nav-tabs">
                                <li class="active">
                                    <a href="javascript:void(history.back())" >返回上一页</a>
                                </li>
                            </ul>
                        </header>
                        <div class="panel-body">
                            <div class="tab-content">
                                <div id="noPayOrders" class="tab-pane active">
								<!-- 顾客订单 -->
					       			<table class="display table table-bordered table-striped dataTable table-hover" id="dynamic-table" aria-describedby="dynamic-table_info">								   	    		
					        			<thead>
								        	<tr role="row">
								        		<th role="columnheader" tabindex="0" aria-controls="dynamic-table" rowspan="1" colspan="1"  aria-label="Rendering engine: activate to sort column ascending">商品ID</th>
								        		<th role="columnheader" tabindex="0" aria-controls="dynamic-table" rowspan="1" colspan="1" aria-label="Rendering engine: activate to sort column ascending">商品首图</th>						        	
								        		<th role="columnheader" tabindex="0" aria-controls="dynamic-table" rowspan="1" colspan="1"  aria-label="Rendering engine: activate to sort column ascending">商品信息</th>
								        		<th role="columnheader" tabindex="0" aria-controls="dynamic-table" rowspan="1" colspan="1"  aria-label="Rendering engine: activate to sort column ascending"> 配件信息</th>
								        		<th role="columnheader" tabindex="0" aria-controls="dynamic-table" rowspan="1" colspan="1"  aria-label="Rendering engine: activate to sort column ascending">商品价格</th>
								        		<th role="columnheader" tabindex="0" aria-controls="dynamic-table" rowspan="1" colspan="1"  aria-label="Rendering engine: activate to sort column ascending">测量信息</th>
								        		<th role="columnheader" tabindex="0" aria-controls="dynamic-table" rowspan="1" colspan="1"  aria-label="Rendering engine: activate to sort column ascending">接单人</th>
								        		<th role="columnheader" tabindex="0" aria-controls="dynamic-table" rowspan="1" colspan="1"  aria-label="Rendering engine: activate to sort column ascending">备注</th>													        		
												<!-- <th tabindex="0" aria-controls="dynamic-table" rowspan="1" colspan="1"  aria-sort="descending" aria-label="Browser: activate to sort column ascending">配件详情</th>  -->  					        		
								        	</tr>
								        </thead>
								        <tbody>
								        
			
								        <c:forEach items="${list}" var="s">
								        <tr role="row">
								        	    <th role="columnheader" tabindex="0" aria-controls="dynamic-table" rowspan="1" colspan="1"  aria-label="Rendering engine: activate to sort column ascending">${s.get("sampleId")}</th>
								        	    <th role="columnheader" tabindex="0" aria-controls="dynamic-table" rowspan="1" colspan="1" aria-label="Rendering engine: activate to sort column ascending"><c:if test="${s.get('img')!=null}"><img src="http://okwc9gyzs.bkt.clouddn.com/${s.get('img')}" style="width:200px"></c:if></th>						        	
								        		<th role="columnheader" tabindex="0" aria-controls="dynamic-table" rowspan="1" colspan="1"  aria-label="Rendering engine: activate to sort column ascending">
								        		
								        		
								        		<c:if test="${s.get('type')==0}">
								        			类型:布艺帘<br>
								        		</c:if>
								        		<c:if test="${s.get('type')==1}">
								        			类型:成品帘<br>
								        		</c:if>
								        		<c:if test="${s.get('type')==2}">
								        			类型:配件<br>
								        		</c:if>
								        		
								        		<c:if test="${s.get('number')==1}">
								        			单/双：单${s.get("accessoriesType")}<br>
								        		</c:if>
								        		<c:if test="${s.get('number')==2}">
								        			单/双：双${s.get("accessoriesType")}<br>
								        		</c:if>
								        		<c:if test="${s.get('saleNumber')!=null}">
								        			杆长:${s.get("saleNumber")}<br>
								        		</c:if>
								        		
								        		<c:if test="${s.get('accessoriesType')!=null}">
								        			类型:${s.get("accessoriesType")}<br>
								        		</c:if>
								        		
								        		<c:if test="${s.get('acc')!=null}">
								        			配饰:${s.get("acc")}<br>
								        		</c:if>
								 					        		
								        		<c:if test="${s.get('style')==0}">
								        			款式：打孔<br>
								        		</c:if>
												<c:if test="${s.get('style')==1}">
								        			款式：韩折<br>
								        		</c:if>
								        		
								        
								        		
								        		<c:if test="${s.get('installCase')==1}">
								        			安装情况：相同位置安装<br>
								        		</c:if>
								        		<c:if test="${s.get('installCase')==0}">
								        			安装情况：分开安装<br>
								        		</c:if> 
								     			        		
								        		<c:forEach items="${s.get('chicun')}" var="c">
								        			        		
										        		<c:if test="${c.type==0}">
										        			 	<c:if test="${c.wide!=null}">布宽:${c.wide}</c:if>&nbsp;&nbsp;<c:if test="${c.high!=null}">布高:${c.high}</c:if><br>
										        		</c:if>	
										        		<c:if test="${c.type==1}">
										        				<c:if test="${c.wide!=null}">纱宽:${c.wide}</c:if>&nbsp;&nbsp;<c:if test="${c.high!=null}">纱高:${c.high}</c:if><br>
										        		</c:if>
										        		<c:if test="${c.type==2}">
										        			  	<c:if test="${c.wide!=null}">帘头宽:${c.wide}</c:if>&nbsp;&nbsp;<c:if test="${c.high!=null}">帘头高:${c.high}</c:if><br>
										        		</c:if>
										        		<c:if test="${c.type==3}">
										        			  	<c:if test="${c.wide!=null}">成品帘宽:${c.wide}</c:if>&nbsp;&nbsp;<c:if test="${c.high!=null}">成品帘高:${c.high}</c:if><br>
										        		</c:if>
										        		
								        		</c:forEach>
								        		
								        			
								        	
								        		</th>
								        		
								        		<th role="columnheader" tabindex="0" aria-controls="dynamic-table" rowspan="1" colspan="1"  aria-label="Rendering engine: activate to sort column ascending">
								        			<c:forEach items="${s.get('chicun')}" var="c">
								        				<c:if test="${c.sampleId!=null}">
								        				        配件id:<a href="<%=request.getContextPath() %>/indent/peijianXq2.do?goodsId=${c.l}"  data-toggle="modal" data-target="#myModal" type="button" >${c.sampleId}</a><br>
								        				</c:if>
								        				<c:if test="saleNumber!=null">
								        					 杆长:${c.saleNumber}<br>
								        				</c:if>
								        				<c:if test="${c.number!=null}">
										        			 单/双:<c:if test="${c.number==1}">单${c.accessoriesType}</c:if><c:if test="${c.number==2}">双${c.accessoriesType}</c:if><br>
										        		</c:if>
								
										        		<c:if test="${c.panzhuangfangshi!=null}">
										        			 安装情况:${c.panzhuangfangshi}<br>
										        		</c:if>
										        		<c:if test="${c.pinstallSite!=null}">
										        			 安装方式:${c.pinstallSite}<br>
										        		</c:if>
										        		<c:if test="${c.acc!=null}">
										        			 配件配饰:${c.acc}<br>
										        		</c:if>
										        		<c:if test="${c.accessoriesType!=null&&s.get('installCase')!=1}">
										        		 	配件类型:${c.accessoriesType}<br>  		
								        				</c:if>					        			
								        			</c:forEach>
								        		</th>
								        		<th role="columnheader" tabindex="0" aria-controls="dynamic-table" rowspan="1" colspan="1"  aria-label="Rendering engine: activate to sort column ascending">
								        				
								        				  <c:choose>
									        			 	<c:when test="${s.get('type')!=0}">
									        			 		<c:if test="${s.get('goodsPrice')!='0.0'}">
										        					商品价格:${s.get("goodsPrice")} (￥${s.get("price")}/米)<br>
										        				</c:if >
									        			 	</c:when>
									        			 	<c:otherwise>
									        			 		<c:if test="${s.get('sumBPrice')!='0.0'}">
										        						布价格:${s.get("sumBPrice")} 							        					
												        				<c:if test="${s.get('style')==0}">
												        						(￥${s.get("holePrice")}/米)
												        				</c:if>
																		<c:if test="${s.get('style')==1}">
														        				(￥${s.get("zhePrice")}/米)
														        		</c:if>
										        					<br>
										        				</c:if>
												        		<c:if test="${s.get('sumSPrice')!='0.0'}">
												        			纱价格:${s.get("sumSPrice")} (￥${s.get("ssPrice")}/米)<br>
												        		</c:if>	        		
									        			 	</c:otherwise>
									        			 </c:choose>   
										        		
										        		
									        		<c:forEach items="${s.get('chicun')}" var="c">
									        			<c:choose>
									        				<c:when test="${s.get('installCase')!=1}">
									        					<c:if test="${c.type==0&&c.goodsPrice!=null}">
										        					  布配件价格:${c.goodsPrice} (￥${c.price}/米)<br>
										        				</c:if>	
										        				<c:if test="${c.type==1&&c.goodsPrice!=null}">
										        					  纱配件价格:${c.goodsPrice} (￥${c.price}/米)<br>
										        				</c:if>
									        				</c:when>
									        				<c:otherwise>
									        					<c:if test="${c.goodsPrice!=null}">
									        						  配件价格:${c.goodsPrice} (￥${c.price}/米)<br>
									        					</c:if>
									        				</c:otherwise>
									        			</c:choose>
										        		<c:if test="${c.type==2&&c.goodsPrice!=null}">
										        			  帘头价格:${c.goodsPrice} /${c.llPrice}<br>
										        		</c:if>
										        				        		
								        			</c:forEach>
									        		
									        		
								        			<c:if test="${s.get('sum').get('sum')+ s.get('goodsPrice')!=null}">
								        				商品合计:￥<fmt:formatNumber type="number" value="${s.get('sum').get('sum')+ s.get('goodsPrice')}" pattern="0.00" maxFractionDigits="2"/>
								        			</c:if>
								        			
								        		</th>
								        		
								        			<th role="columnheader" tabindex="0" aria-controls="dynamic-table" rowspan="1" colspan="1"  aria-label="Rendering engine: activate to sort column ascending">
								        				<c:if test="${s.get('type')!=2}">
								        					<input type="button" data-toggle="modal" data-target="#myModal2" value="测量详情" onclick="celiangxangqing(${s.get('goodsId')})">
								        				</c:if>
								        			</th>
								        		<th role="columnheader" tabindex="0" aria-controls="dynamic-table" rowspan="1" colspan="1"  aria-label="Rendering engine: activate to sort column ascending">	
									        		接单人:${s.get('name')}<br>
									        		手机号:${s.get('phone')}<br>
								        		</th>
								        		<th role="columnheader" tabindex="0" aria-controls="dynamic-table" rowspan="1" colspan="1"  aria-label="Rendering engine: activate to sort column ascending">
								        			<c:forEach items="${s.get('chicun')}" var="c">
								        			        	
										        		<c:if test="${c.remark!=null}">
										        			${c.remark}<br>
										        		</c:if>
										        		
								        			</c:forEach>
								     								        		
								        		</th>

								        		<%-- 	<th tabindex="0" aria-controls="dynamic-table" rowspan="1" colspan="1"  aria-sort="descending" aria-label="Browser: activate to sort column ascending">
								        				<c:if test="${s.get('type')==0}">
								        					<input type="button" onclick="topeijianXq(${s.get('goodsId')})" value="配件详情">
								        					
								        				</c:if>
								        			</th> --%>
								        </tr>
										</c:forEach>
								        </tbody>
									</table>
					
						
                                </div>
             
                          </div>
                      </div>
</section>     
     <!-- 查看详情的模态框 1-->
			<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">  
			    <div class="modal-dialog" style="width:1100px">  
			        <div class="modal-content">  
			            <div class="modal-header">  
			                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>  
			                <h4 class="modal-title" id="myModalLabel">配件信息</h4>  
			            </div>  
			            <div class="modal-body"  style="height:1100px;overflow:auto;">  
			       			
			            </div>  
			            <div class="modal-footer">  
			                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>    
			            </div>  
			        </div>  
			        <!-- /.modal-content -->  
			    </div>  
			    <!-- /.modal -->  
			</div>      
		<!-- 模态框结束 -->  
		
		
		
		
		
		
		 <!-- 查看详情的模态框 2-->
			<div class="modal fade" id="myModal2" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">  
			    <div class="modal-dialog" style="width:1100px">  
			        <div class="modal-content">  
			            <div class="modal-header">  
			                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
			                <h4 class="modal-title" id="myModalLabel">配件信息</h4>  
			            </div>  
			            <div class="modal-body"  style="height:1100px;overflow:auto;">  
			       			
			            </div>  
			            <div class="modal-footer">  
			                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>    
			            </div>  
			        </div>  
			        <!-- /.modal-content -->  
			    </div>  
			    <!-- /.modal -->  
			</div>      
		<!-- 模态框结束 -->       
		
		      
	</div>
</section>
</body>
<script src="<%=request.getContextPath() %>/js/orders/customerOrders.js"></script>
<link href="${ctxPath}/js/bootstrap-table/bootstrap-table.css" rel="stylesheet" />
<!-- tables插件的引用 -->
<script src="${ctxPath}/js/bootstrap-table/bootstrap-table.js"></script>
<script src="${ctxPath}/js/bootstrap-table/locale/bootstrap-table-zh-CN.js"></script>
<script type="text/javascript">


function topeijianXq(id){
	window.location.href = "<%=request.getContextPath() %>/indent/peijianXq.do?goodsId="+id;
}

$('#myModal').on('hidden.bs.modal', function () {
	$(this).removeData("bs.modal");
});

$('#myModal2').on('hidden.bs.modal', function () {
	$(this).removeData("bs.modal");
});

function celiangxangqing(id){
	$("#myModal2").modal({
		remote:"<%=request.getContextPath() %>/indent/celiangXq.do?goodsId="+id
	});
}



</script>
</html>
